Skip to content

ZSA integration (step 5): Modify Orchard proptest implementations to support ZSA#18

Closed
dmidem wants to merge 8 commits into
zsa-integration-genericsfrom
zsa-integration-proptest
Closed

ZSA integration (step 5): Modify Orchard proptest implementations to support ZSA#18
dmidem wants to merge 8 commits into
zsa-integration-genericsfrom
zsa-integration-proptest

Conversation

@dmidem
Copy link
Copy Markdown
Collaborator

@dmidem dmidem commented Oct 17, 2024

Updates the existing Orchard property-based test implementations to include transaction V6 ZSA fields (burn in ShieldedData and orchard_zsa_issue_data).

Changes:

  • Added the TestArbitrary trait to orchard_flavor_ext to conditionally modify the list of constraints for EncryptedNote and BurnType associated types.
  • Implemented Arbitrary for orchard::ShieldedData as a generic type.
  • Introduced a new type, Burn, which wraps Vec<BurnItem>. Implemented serialization/deserialization for it and placed it in orchard_zsa/burn.rs. Also moved NoBurn there from orchard_flavor_ext.rs for better code structuring.
  • Renamed serialize.rs to common.rs in the orchard_zsa folder.
  • Generalized the v5_strategy and v6_strategy functions in transaction/arbitrary.rs to work with V5 and V6 transactions, and to handle burn and issuance for V6.

Note: This is draft code that needs to be cleaned up, possibly refactored/improved, and the FIXMEs resolved.

dmidem added 3 commits October 8, 2024 14:28
1. Introduced new type `Burn` that wraps `Vec<BurnItem>`, implemented serialization/deserialization for it - put it
   into `orchard_zsa/burn.rs`, also moved `NoBurn` there from `orchard_flavor_ext.rs` for better code structuring.
2. Renamed the `EncryptedNoteTest` trait to `TestArbitrary` in `orchard_flavor_ext.rs` and used it to constrain
   `BurnType` as well.
3. Renamed `serialize.rs` to `common.rs` in the `orchard_zsa` folder.
4. Refactored transaction generation strategies for V5 and V6 in `transaction/arbitrary.rs` and
  `orchard_zsa/arbitrary.rs` to incorporate the new burn handling and proper issuance handling.
@dmidem dmidem requested a review from PaulLaux October 17, 2024 09:11
@dmidem dmidem changed the title Step 5: Modify Orchard proptest implementations to support ZSA ZSA integration, step 5: Modify Orchard proptest implementations to support ZSA Oct 18, 2024
@dmidem dmidem changed the title ZSA integration, step 5: Modify Orchard proptest implementations to support ZSA ZSA integration (step 5): Modify Orchard proptest implementations to support ZSA Oct 18, 2024
@PaulLaux PaulLaux requested a review from arya2 October 31, 2024 15:08
@dmidem
Copy link
Copy Markdown
Collaborator Author

dmidem commented Jan 11, 2025

Closed in favour of #37

@dmidem dmidem closed this Jan 11, 2025
dmidem added a commit that referenced this pull request Jun 23, 2025
This pull request merges the changes from several incremental PRs into
one cumulative set of updates on top of the `zsa1` branch. It introduces
ZSA-compatible crates, Network Upgrade 7 (Nu7), initial Transaction V6
support, Orchard generics for ZSA, property-based testing enhancements,
note commitment handling for ZSA issuance, and initial consensus
modifications for Orchard ZSA.

It does not include the final state management changes or additional
tests — those come in subsequent PRs.

Below is a high-level overview of the merged changes:

1. **ZSA-Compatible Crates Integration (Step 1)**
   #24: 
- Replaces core libraries (`halo2`, `zcash_note_encryption`, etc.) with
QED-it’s ZSA-compatible forks.
- Maintains full support for Orchard “Vanilla” without activating any
new ZSA features yet.

2. **Network Upgrade 7 (Nu7) Support (Step 2)**
   #15  
- Introduces code paths and placeholders for Nu7, the upcoming network
upgrade required for ZSA.
- Adds `FIXME` comments where final activation heights and other
specifics must be filled in.

3. **Transaction V6 Foundations (Step 3)**
   #16  
- Adds a `V6` variant to Zebra’s `Transaction` enum, initially mirroring
`V5` logic.
- Sets a baseline for future ZSA-related modifications, including
placeholders for relevant fields and logic.

4. **Refactor Orchard Structures to Generics (Step 4)**
   #17  
- Converts key Orchard data structures (e.g., `ShieldedData`) to
generics, enabling a single code path for both Orchard Vanilla and
Orchard ZSA.
- Implements serialization/deserialization for `V6` transactions,
including a `burn` field in the ZSA flavor.

5. **Orchard Proptests with ZSA Enhancements (Step 5)**
   #18
- Extends the property-based testing framework to handle ZSA-specific
fields and behaviors in `Transaction V6`.
- Refactors code organization (e.g., extracting `Burn` types) for better
clarity and future expansion.

6. **Integration of ZSA Issuance Commitments (Step 6)**
   #25
- Merges issuance action note commitments with existing shielded data
commitments for `V6` transactions.
- Ensures `Transaction::orchard_note_commitments` includes issuance note
commitments when present, preserving `V5` behavior.

7. **Initial ZSA Consensus Support (Step 7)**
   #28
   - Modifies `zebra-consensus` to support Orchard ZSA.  

**Next Steps**  
- **State Management & Additional Testing**: Future PRs will introduce
state-layer modifications, refine consensus checks, and add more
comprehensive tests.

By consolidating these first several steps into a single PR, we aim to
simplify the review process .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant